package mybatis.config;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 自定义字符串处理器
 */
public class MyStringTypeHandler implements MyTypeHandler<String> {
    @Override
    public void setParameter(PreparedStatement preparedStatement, int i, Object value) throws SQLException {
        preparedStatement.setString(i, (String) value);
    }

    @Override
    public String getResult(ResultSet rs, String columnName) throws SQLException {
        return rs.getString(columnName);
    }
}
